package test2;

public class PhoneTest {
    public static void main(String[] args) {
        Phone[] arr = new Phone[3];

        Phone p1 = new Phone("小米","白色",1999);
        Phone p2 = new Phone("华为","黑色",4999);
        Phone p3 = new Phone("苹果","蓝色",3999);

        arr[0] = p1;
        arr[1] = p2;
        arr[2] = p3;

        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum+=arr[i].getPrice();
        }

        int average = sum/arr.length;

        System.out.println(average);

    }
}
